﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Backend.DTO;

namespace ReSeSSApplication
{
    public partial class AdministratorDashboard : System.Web.UI.Page
    {
        protected UserDTO loggedInUserDTO = new UserDTO();

        protected void Page_Load(object sender, EventArgs e)
        {
            loggedInUserDTO = (UserDTO)Session["LoggedInUserDTO"];
            RedirectUser(loggedInUserDTO);
        }

        protected void RedirectUser(UserDTO userDTO)
        {
            if (userDTO != null)
            {
                if (userDTO.UserType == "User")
                {
                    Response.Redirect("UserDashboard.aspx");
                }
            }
            else
            {
                Response.Redirect("Index.aspx");
            }
        }
    }
}